package com.glg.book.service;

import com.glg.book.dao.BookDao;
import com.glg.book.model.BookInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;


@Component
public class BookService {
    @Autowired
    private BookDao bookDao;

    public List<BookInfo> getBookList() {
        //BookDao bookDao = new BookDao();
        List<BookInfo> bookInfos = new ArrayList<>();
        for(BookInfo bookInfo : bookInfos){
            if(bookInfo.getStatus() == 2){
                bookInfo.setStatusCN("不可借阅");
            }else {
                bookInfo.setStatusCN("可借阅");
            }
        }
        return bookInfos;
    }
}
